package com.example.servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet("/AdminOutLoginServlet")
public class AdminOutLoginServlet extends HttpServlet{
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.getSession().removeAttribute("user");
        request.getSession().removeAttribute("userList");
        request.getSession().removeAttribute("novelList");
        request.getSession().removeAttribute("userCount");
        request.getSession().removeAttribute("novelCount");
        request.getSession().removeAttribute("userPageCount");
        request.getSession().removeAttribute("novelPageCount");
        request.getSession().removeAttribute("userPage");
        request.getSession().removeAttribute("novelPage");
        request.getSession().removeAttribute("userTemp");
        request.getSession().removeAttribute("novelTemp");
        request.getSession().removeAttribute("reviewCount");
        request.getSession().removeAttribute("reviewList");
        request.getSession().removeAttribute("reviewPage");
        request.getSession().removeAttribute("reviewPageCount");

        response.sendRedirect(request.getContextPath()+"/login.jsp");
    }
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request,response);
    }
}
